package com.blue.integration.serve.netpopo;

import com.blue.core.http.HttpInvoker;
import com.blue.integration.serve.OcrException;
import org.springframework.beans.factory.InitializingBean;

/**
 * OCR识别抽象类
 *
 * @author zhengjin
 * @since 1.0 2017年11月29日
 */
public abstract class AbstractOcrClient implements InitializingBean
{
	protected HttpInvoker httpInvoker;

	protected String appCode;
	protected String url;

	public AbstractOcrClient()
	{
	}

	@Override
	public void afterPropertiesSet() throws Exception
	{
		if (appCode == null || appCode.isEmpty())
			throw new OcrException(OcrException.CONFIG + "appCode");
		if (url == null || url.isEmpty())
			throw new OcrException(OcrException.CONFIG + "url");
	}

	public void setHttpInvoker(HttpInvoker httpInvoker)
	{
		this.httpInvoker = httpInvoker;
	}

	public void setAppCode(String appCode)
	{
		this.appCode = appCode;
	}

	public void setUrl(String url)
	{
		this.url = url;
	}

}
